<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title></title>
  	<script type="text/javascript" src="js/jquery-1.8.2.js"></script> 
    <script type="text/javascript" src="js/common.js"></script> 
	<script type="text/javascript" src="js/jquery.form.js"></script>
</head>
  <body>
 
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">用户修改</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
    	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	      <tr>
	        <td colspan="2" valign="top">
	      		<!--  控件按钮栏-->
		         <TABLE class=main_tab id=mainTable cellSpacing=0 cellPadding=0 width=100% border=0>
		             <tr>
		             	<td>
		                 	 <input type="button" name="saveAdmin"  id="saveAdmin"  value="保存" onclick="submitForm()">
		                </td>
		             </tr>
			      </TABLE>
		     </td>
		     <td>&nbsp;</td>
		  </tr>
		  <tr>
	        <td height="40" colspan="4">
	        	<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
			          <tr>
			            <td></td>
			          </tr>
	        	</table>
	        </td>
		  </tr>
		  <tr>
		  	 <td colspan="30">
		     <!--  table栏-->
		      <form id="saveAdminForm" action="<%=basePath%>/adminAction_modifyAdminInfo.action"  method="post">
					    <table align="left">  
					    	  <tr>
							       	<td> 用户ID:</td>
							       	<td> <input type="text"  id="stAdminId"  name="adminBean.stAdminId" value="${bean.stAdminId}" readOnly/><font size="5" color="#FF4500">*</font></td>
							       	<td> 用户编号:</td>
							       	<td> <input type="text"  id="stAdminNumber"  name="adminBean.stAdminNumber"  value="${bean.stAdminNumber}" /><font size="5" color="#FF4500">*</font></td>
							   </tr>
						       <tr>
							       	<td> 用户账号: </td>
							       	<td> <input type="text"  id="stAdminCounter"  name="adminBean.stAdminCounter" value="${bean.stAdminCounter}" /><font size="5" color="#FF4500">*</font></td>
							        <td> 用户登录密码:</td>
							       	<td> <input type="text"  id="stAdminPassword"  name="adminBean.stAdminPassword"  value="${bean.stAdminPassword}" /><font size="5" color="#FF4500">*</font></td>
							  </tr>
							  <tr>
							  		<td>用户名称：</td>
							  		<td><input type="text"  id="stAdminEmployer"  name="adminBean.stAdminEmployer" value="${bean.stAdminEmployer}" /></td>
							       	<td> 用户邮箱：</td>
							       	<td> <input type="text"  id="stAdminEmail"  name="adminBean.stAdminEmail" value="${bean.stAdminEmail}" /></td>
							  </tr>
							   <tr>
							  		<td>用户移动电话：</td>
							  		<td><input type="text"  id="stAdminMobilePhone"  name="adminBean.stAdminMobilePhone" value="${bean.stAdminMobilePhone}" /></td>
							       	<td>用户固定电话：</td>
							       	<td> <input type="text"  id="stAdminPhone"  name="adminBean.stAdminPhone"  value="${bean.stAdminPhone}" /></td>
							  </tr>
							  <tr>
							  		<td>用户IP：</td>
							  		<td><input type="text"  id="stAdminIp"  name="adminBean.stAdminIp"  value="${bean.stAdminIp}" /></td>
							       	<td>用户备注：</td>
							       	<td><textArea  id="stRemark"  name="adminBean.stRemark" cols="25" rows="4" >${bean.stRemark}</textArea> </td>
							  </tr>
							  <tr>
							       	<td>用户状态:</td>
							       	<td><select   id="stState"  name="adminBean.stState">
								       	   <c:choose>
								       	        <c:when test="${admin.stState == 1000 }">
										       	     <option value="1000" selected>有效</option>
										       		 <option value="9999" >无效</option>
									       		 </c:when>
								       		 <c:otherwise>
								       		 	 <option value="1000" >有效</option>
									       		 <option value="9999" selected >无效</option>
								       		 </c:otherwise>
								       </c:choose>
							       	    </select><font size="5" color="#FF4500">*</font>
							       	</td>
							  </tr>
					 	</table>
				</form>
		        </td>
		  </tr>
		  <!-- 翻页工具  -->
		  <tr>
		     <td colspan="8">
		     </td>
		  </tr>
	      <tr>
	        <td height="40" colspan="4">
	        	<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
			          <tr>
			            <td></td>
			          </tr>
	        	</table>
	        </td>
	      </tr>
	      <tr>
	        <td width="2%">&nbsp;</td>
	        <td width="51%" class="left_txt"><img src="images/icon-mail2.gif" width="16" height="11"><br>
	              <img src="images/icon-phone.gif" width="17" height="14"> </td>
	        <td>&nbsp;</td>
	        <td>&nbsp;</td>
	      </tr>
	</table>
    </td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
</tr>
<tr>
   <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
   <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
   <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
</tr>
</table>

  </body>
  <script type="text/javascript">
	function submitForm(){  
	    var stAdminId = document.getElementById("stAdminId").value;  
	    var stAdminNumber =  document.getElementById("stAdminNumber").value;  
	    var stAdminCounter =  document.getElementById("stAdminCounter").value;  
	    var stAdminEmployer =  document.getElementById("stAdminEmployer").value;  
	    var stAdminEmail =  document.getElementById("stAdminEmail").value;  
	    var stAdminMobilePhone =  document.getElementById("stAdminMobilePhone").value;  
	    var stAdminPhone =  document.getElementById("stAdminPhone").value; 
	    var stAdminIp =  document.getElementById("stAdminIp").value;
	    var stRemark =  document.getElementById("stRemark").value;
	    var stState =  document.getElementById("stState").value;
		
		if(stAdminId == null || stAdminId == ""){
			alert("用户ID不能为空");
			return false;
		}
		
		if(stAdminNumber == null || stAdminNumber == ""){
			alert("用户编号不能为空");
			return false;
		}
		
		if(stAdminCounter == null || stAdminCounter == ""){
			alert("用户账号不能为空");
			return false;
		}
		      
		var  regNumber=/^(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$/;
		if(!regNumber.exec(stAdminMobilePhone)){
			alert("用户移动电话格式错误");
			return false;
		}
		
		regNumber=/^[0-9]{7,8}$/;
		if(!regNumber.exec(stAdminPhone)){
			alert("用户固定电话格式错误");
			return false;
		}
		
		regNumber=/^[0-9a-zA-Z]{0,24}$/;
		if(!regNumber.exec(stAdminNumber)){
			alert("用户编号长度或格式出错");
			return false;
		}
		
		if(!regNumber.exec(stAdminCounter)){
			alert("用户账号长度或格式出错");
			return false;
		}
		
		var form = document.getElementById("saveAdminForm");  
		form.submit();   
    }
</script>
</html>
